trait Foo {
  type Arg
  type Prod
  def makeProd(a : Arg): Prod
}

// simulate dependent method types
case class buildProd[TFoo <: Foo](foo: TFoo) {
  def apply(a: foo.Arg): foo.Prod = foo.makeProd(a)
}

object Test extends Application {
  val myFoo = new Foo{type Arg=Int; type Prod=(Int, Int); def makeProd(i: Int) = (i, i)}

  println(buildProd(myFoo)(1))
}